package she_ji_mo_shi.gong_chang.client;

import common.util.XmlUtil;
import she_ji_mo_shi.gong_chang.factory.DbLoggerFactory;
import she_ji_mo_shi.gong_chang.factory.LoggerFactory;
import she_ji_mo_shi.gong_chang.model.api.Logger;

public class ClientUseLogger {
    public static void main(String[] args) {
        LoggerFactory loggerFactory = new DbLoggerFactory(); // 可以使用xml反射创建优化
        Logger logger = loggerFactory.createLogger();
        logger.writeLog();

        // 从配置文件中读取，使用反射创建工程对象
        LoggerFactory fileLoggerFactory = (LoggerFactory) XmlUtil.getBean();
        Logger fileLogger = fileLoggerFactory.createLogger();
        fileLogger.writeLog();
    }
}
